package net.wds.study.teacher.service.impl;/**
 * Package: net.wds.study.teacher.service.impl
 * Description： TODO
 * Author: 作者
 * Date: Created in 2020/9/9 9:27
 * Company: 公司
 * Version: 0.0.1
 */

import net.wds.study.student.modal.PageModal;
import net.wds.study.teacher.dao.TeacherDao;
import net.wds.study.teacher.entity.Teacher;
import net.wds.study.teacher.service.TeacherService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Serializable;

/**
 * @ClassName : TeacherServiceImpl
 * @Description :
 * @Author : HTB
 * @Date: 2020-09-09 09:27
 */
@Service("teacherService")
public class TeacherServiceImpl implements TeacherService {


    @Resource
    private TeacherDao teacherDao;

    public PageModal<Teacher> getParamByParams(int startIndex, int pageSize, String name, Integer sex) {
       if(startIndex<0){
           startIndex=0;
       }
        return teacherDao.getPageByParam(startIndex,pageSize,name,sex) ;
    }

    @Override
    public Teacher findTeacherById(Integer id) {
        return teacherDao.findTeacherById(id);
    }

    @Override
    public Boolean deleteTeacherById(Integer id) {
        return teacherDao.deleteTeacherById(id);
    }

    @Override
    public boolean updateTeacher(Teacher teacher) {
        return teacherDao.updateTeacher(teacher);
    }

    @Override
    public Serializable addTeacher(Teacher teacher) {
        return teacherDao.addTeacher(teacher);
    }
}
